package com.ly.sy.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author liangyu
 * @since 2020-11-11
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Comment对象", description="")
public class Comment implements Serializable {

    private static final long serialVersionUID = 1L;
    //当点击评论内容就如评论回复界面，用id值和节点比较，获取到所有回复
    //用户可以在该界面回复你
    @ApiModelProperty(value = "评论ID")
    @TableId(value = "comment_id", type = IdType.AUTO)
    private Integer commentId;

    @ApiModelProperty(value = "用户ID")
    private Integer userId;

    @ApiModelProperty(value = "课程ID")
    private Integer courseId;

    @ApiModelProperty(value = "评论内容")
    private String commentP;
    //先把父节点为0的评论拿出来，得到所有评论主题
    //用本条评论的id和父节点比较，相等的i++，得到回复数
    //这里需要根据评论id查找用户id得到用户对象获取用户名
    @ApiModelProperty(value = "评论父节点")
    private Integer father;


}
